package com.woniuxy.uums.controller;

import com.woniuxy.common.utils.FaceUploadResult;
import com.woniuxy.uums.pojo.FaceInfo;
import com.woniuxy.uums.service.FaceInfoService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/faceInfo")
@AllArgsConstructor
public class FaceInfoController {
    private FaceInfoService faceInfoService;

    @PostMapping("/addFaceInfo")
    @ResponseBody
    public void addFaceInfo(@RequestBody FaceInfo faceInfo){
        faceInfoService.save(faceInfo);
    }
    @PostMapping("/upload")
    @ResponseBody
    public FaceUploadResult uploadFace(@RequestParam String imageUrl,
                                       @RequestParam String userId) {
        return faceInfoService.uploadFaceImage(imageUrl, userId);
    }
}
